from threading import Thread
class Threadgroup(Thread):
    def maintask():
        for i in range(5,500,15):
            print('mainthread',i)
    def subtask():
        for i in range(10,1000,10):
            print('subthread',i)
    mainthread=Thread(target=maintask)
    subthread=Thread(target=subtask)
    def start(self):
        Threadgroup.mainthread.start()
        Threadgroup.subthread.start()
t=Threadgroup()
t.start()
